home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Texteditors
/
Origami
/
Sources
/
scripts
/
install_file
< prev
next >
Wrap
Text File
|
1996-09-26
|
651b
|
50 lines
#! /bin/sh
: &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
#{{{ get mode
mode="755"
if test x$1 = x-m
then
shift
mode=$1
shift
fi
#}}}
ifile=$1
shift
file=$1
dir=$1
#{{{ get list of needed dirs
dir_list=""
while test 1
do
#{{{ break on .
if test $file = "."
then
break
fi
#}}}
#{{{ break on /
if test $file = "/"
then
break
fi
#}}}
dir_list="$file $dir_list"
file=`dirname $file`
done
#}}}
#{{{ mk all needed dirs
for i in $dir_list
do
if test -d $i
then
:
else
mkdir $i
chmod $mode $i
fi
done
#}}}
cp $ifile $dir
chmod $mode $dir/`basename $ifile`